import requests
import config
class HomeAPI:
    #初始化
    def __init__(self):
        self.url_banner = config.BASE_URL + "/banner/1"
        self.url_theme = config.BASE_URL + "/theme?ids=1,2,3"
        self.url_recent = config.BASE_URL + "/product/recent"

    #获取轮播图
    def get_banner(self):
        return requests.get(url=self.url_banner)
    #获取专题栏位
    def get_theme(self):
        return requests.get(url=self.url_theme)
    #获取最近新品
    def get_recent(self):
        return requests.get(url=self.url_recent)

if __name__ == '__main__':
    #获取轮播图
    print(HomeAPI().get_banner().json())
    #专题栏位
    print(HomeAPI().get_theme().json())
    #最近新品
    print(HomeAPI().get_recent().json())